package com.future.hedongjun.mall.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.future.baselib.utils.GlideUtils;
import com.future.hedongjun.R;
import com.future.hedongjun.common.PriceHelper;
import com.future.hedongjun.home.bean.TopicBean;
import com.future.hedongjun.mall.bean.GoodsItem;

import java.util.List;

/**
 * @author jniu
 * @Email niuxiaoqi@hztianque.com
 * @time 2018/11/14
 */
public class GoodsAdapter extends BaseQuickAdapter<GoodsItem, BaseViewHolder> {
    public GoodsAdapter(@Nullable List<GoodsItem> data) {
        super(R.layout.recycler_item_topic, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsItem item) {
        GlideUtils.loadTopRoundImage(mContext, item.getImage(), (ImageView) helper.getView(R.id.iv_icon));
        helper.setText(R.id.tv_title, item.getGoods_name());
        helper.setText(R.id.tv_price, PriceHelper.priceFormat(item.getPrice()));
    }
}
